package com.dream.inspect.modules.business.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.dream.inspect.modules.business.entity.CheckName;
import com.dream.inspect.modules.business.entity.SuperviseRecordEntity;
import com.dream.inspect.modules.business.entity.ToDeptInfo;
import com.dream.inspect.modules.dream.pojo.SuperviseRecordFormMap;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 督察记录表
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2018-06-16 17:04:52
 */
public interface SuperviseRecordDao extends BaseMapper<SuperviseRecordEntity> {
	List<SuperviseRecordEntity> findSuperviseRecordList(@Param("ew") Wrapper<SuperviseRecordEntity> wrapper,
                                                        @Param("currPage") int currPage,
                                                        @Param("pageSize") int pageSize);

	int findSuperviseRecordListCount(
            @Param("ew") Wrapper<SuperviseRecordEntity> wrapper);

	SuperviseRecordEntity findSuperviseRecordById(@Param("ew") Wrapper<SuperviseRecordEntity> wrapper);

	public List<SuperviseRecordFormMap> findBackupList(@Param("map") Map<String, Object> map, Page<SuperviseRecordFormMap> page);
	void delBackupDatas(@Param("userId") String userId,
                        @Param("rId") String rId,
                        @Param("flag") String flag);

	Map<String,Object> getRecordByBackuoId(@Param("userId") String userId, @Param("rId") String rId);
	int checkSuperviseRecordCount(@Param("ew") Wrapper<SuperviseRecordEntity> wrapper);

	int selectThisMonthCount(@Param("ew") Wrapper<SuperviseRecordEntity> wrapper);

	List<SuperviseRecordFormMap> findSuperviseRecordByProjectId(@Param("map") Map<String, Object> map);

	SuperviseRecordEntity findSuperviseRecordForSearchPage(@Param("id") String id);

	int findSuperviseRecordForSearchPageCount(@Param("ew") Wrapper<SuperviseRecordEntity> wrapper);

	List<SuperviseRecordEntity> selectSuperviseRecordListPage(Pagination page, @Param("srEntity") SuperviseRecordEntity srEntity);
	List<SuperviseRecordEntity> getToDeptByProjectId(@Param("pId") String id);

	List<ToDeptInfo> findToDeptInfo(@Param("pId") String id);
	List<ToDeptInfo> findToDeptAllInfo(@Param("pId") String id);
	List<CheckName> getCheckNameList(@Param("rId") String id);
	int findWtDeptNum(@Param("pId") String id);
	int findZglxDeptNum(@Param("pId") String id, @Param("zglx") String zglx);

	SuperviseRecordEntity selectSuperviseRecordByIdDetail(@Param("srEntity") SuperviseRecordEntity srEntity);
}
